<?php
include($_SERVER['DOCUMENT_ROOT'].'/Map.php');


$exceptions = array
(
    "1E" => array
    (
        0.018035173416138,
		0.029349088668823,
		0.048596143722534,
		0.057651042938232,
		0.070654153823853,	
     ),
     "2E" => array
    (
        0.020424842834473,
		0.028589010238647,
		0.052020072937012,
		0.067399024963379,
		0.082658052444458,	
     ),
     "3E" => array
    (
        0.022738933563232,
		0.030224084854126,
		0.055243015289307,
		0.087050199508667,
		0.12616515159607,	
     ),
     "4E" => array
    (
        0.024181842803955,
		0.031101942062378,
		0.052107095718384,
		0.052743911743164,
		0.081086158752441,	
     ),
     "5E" => array
    (
        0.022679090499878,
		0.02307915687561,
		0.049070835113525,
		0.042330026626587,
		0.08804988861084,	
     )
);
function countTime()
{
    list($usec, $sec) = explode(" ", microtime());
    return ((float)$usec + (float)$sec);
}
echo('<table cellpadding="5" cellspacing="0" border="1">');

	echo('<tr>');
	echo('<th>Map Dimension</th>');
	echo('<th>Time with all exceptions</th>');
	echo('<th>Time without 1 exceptions</th>');
	echo('<th>Time without 2 exceptions</th>');
	echo('<th>Time without 3 exceptions</th>');
	echo('<th>Time without 4 exceptions</th>');
	echo('<th>Time without 5 exceptions</th>');
	echo('</tr>');
	
	for ($i=1; $i<6; $i++)
	{
		echo('<tr>');
		echo('<th>' . 10 . 'x' . $i*5 . '</th>');
		echo('<td>');
			$time_start = countTime();
			$map = new Map(10, $i*5, 0);
			$time_end = countTime();
			$time = $time_end - $time_start;
			echo $time;
		echo('</td>');
		echo('<td>');
		var_dump($exceptions["1E"][$i-1]);
		echo('</td>');
		echo('<td>');
		var_dump($exceptions["2E"][$i-1]);
		echo('</td>');
		echo('<td>');
		var_dump($exceptions["3E"][$i-1]);
		echo('</td>');
		echo('<td>');
		var_dump($exceptions["4E"][$i-1]);
		echo('</td>');
		echo('<td>');
		var_dump($exceptions["5E"][$i-1]);
		echo('</td>');
		echo('</tr>');
	}
	echo('<th>Average</th>');
	echo('<th>'). $time/5 .('</th>');
	echo('<th>');
	var_dump(($exceptions["1E"][0]+$exceptions["1E"][1]+$exceptions["1E"][2]+$exceptions["1E"][3]+$exceptions["1E"][4])/5);
	echo('</th>');
	echo('<th>');
	var_dump(($exceptions["2E"][0]+$exceptions["2E"][1]+$exceptions["2E"][2]+$exceptions["2E"][3]+$exceptions["2E"][4])/5);
	echo('</th>');
	echo('<th>');
	var_dump(($exceptions["3E"][0]+$exceptions["3E"][1]+$exceptions["3E"][2]+$exceptions["3E"][3]+$exceptions["3E"][4])/5);
	echo('</th>');
	echo('<th>');
	var_dump(($exceptions["4E"][0]+$exceptions["4E"][1]+$exceptions["4E"][2]+$exceptions["4E"][3]+$exceptions["4E"][4])/5);
	echo('</th>');
	echo('<th>');
	var_dump(($exceptions["5E"][0]+$exceptions["5E"][1]+$exceptions["5E"][2]+$exceptions["5E"][3]+$exceptions["5E"][4])/5);
	echo('</th>');
	echo('</table>');
?>
